<template>
  <div class="radio-group-div">
    <div class="radio-group-span">{{radioGroupItem}}：</div>
    <slot></slot>
  </div>
</template>

<script>
export default{
  name: "RadioGroupComponent",
  data(){
    return{
      submitParam:undefined
    }
  },
  props:{
    radioGroupItem:String,
    radioGroupName:String
  },
  methods:{
    radioSelectChange(value){
      if(value!==this.submitParam){
        this.submitParam = value;
      }
    },
    getInputValue(){
      return { "name":this.radioGroupName , "value" : this.submitParam };
    }
  },
  mounted() {
    this.$on("inputValueChange",this.radioSelectChange);
    this.$parent.$emit("inputRegist",this.radioGroupName,this);
  }
};

</script>

<style scoped>
.radio-group-div{
  display: inline-block;
  text-align: right;
  padding-right: 20px;
  padding-bottom: 15px;
}
.radio-group-span{
  display: inline-block;
  width: 120px;
  text-align: right;
  padding-right: 5px;
}
</style>